package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

/**
 * @Author 快点干早点散
 * @Create 2025/3/29 17:15
 * Description:
 */
@Data
public class LeaseException extends RuntimeException {
    private int code; //每次异常携带的具体返回状态码 -》 result

    public LeaseException(String message, int code) {
        super(message);
        this.code = code;
    }

    public LeaseException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }


}
